package com.hooper.wallet.config;

import com.hooper.wallet.domain.RedissonProperties;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
/**
 * Redisson配置
 * @author Tim Hooper
 * @version 1.0
 * @time 2023/03/08/00:30
 */
@Configuration
public class RedissonConfig {
    @Resource
    private RedissonProperties redissonProperties;

    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer().setAddress(redissonProperties.getUrl());
        return Redisson.create(config);
    }


}